package com.tansun.ruledata.entity;

import java.util.Date;

import org.hibernate.validator.constraints.Length;

/**
 * 规则发布Entity
 *
 * @author lixs
 * @version 2017-04-11
 */

public class RuleDeployment extends RuleBaseEntity<RuleDeployment> {

    private static final long serialVersionUID = 1L;
    private String deployName;        // 发布名称
    private String deployCode;
    private String projectName;        // 规则库名
    private String projectCode;        // 规则库编码
    private String userName;        // 上传用户名
    private String password;        // 上传密码
    private String serverUrl;        // 上传服务地址
    private String statusInd;
    
    /**
     * 扩展字段
     */
    private String enterPoints;


    /**
     * 创建人
     */
    private String createdName;

    /**
     * 修改人
     */
    private String modifiedBy;

    public RuleDeployment() {
        super();
    }

    public RuleDeployment(String id) {
        super(id);
    }

    @Length(min = 0, max = 50, message = "发布名称长度必须介于 0 和 50 之间")
    public String getDeployName() {
        return deployName;
    }

    public void setDeployName(String deployName) {
        this.deployName = deployName;
    }

    @Length(min = 0, max = 50, message = "规则库名长度必须介于 0 和 50 之间")
    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    @Length(min = 0, max = 50, message = "规则库编码长度必须介于 0 和 50 之间")
    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    @Length(min = 0, max = 50, message = "上传用户名长度必须介于 0 和 50 之间")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Length(min = 0, max = 50, message = "上传密码长度必须介于 0 和 50 之间")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Length(min = 0, max = 100, message = "上传服务地址长度必须介于 0 和 100 之间")
    public String getServerUrl() {
        return serverUrl;
    }

    public void setServerUrl(String serverUrl) {
        this.serverUrl = serverUrl;
    }

    public String getDeployCode() {
        return deployCode;
    }

    public void setDeployCode(String deployCode) {
        this.deployCode = deployCode;
    }

    public String getStatusInd() {
        return statusInd;
    }

    public void setStatusInd(String statusInd) {
        this.statusInd = statusInd;
    }

	public String getEnterPoints() {
		return enterPoints;
	}

	public void setEnterPoints(String enterPoints) {
		this.enterPoints = enterPoints;
	}

	public String getSql() {
		return "insert INTO rule_deployment (id,deploy_name,project_name,project_code,server_url,create_date,create_by,status_ind,data_version) values(?,?,?,?,?,?,?,?,?)";
	}
	
	public String getExeSql() {
		return "insert INTO rule_exe_deployment (id,deploy_name,project_name,project_code,server_url,create_date,create_by,status_ind,data_version) values(?,?,?,?,?,?,?,?,?)";
	}
	public Object[] getArgs(String timeStamp) {
		return new Object[] {this.id,this.deployName,this.projectName,this.projectCode,this.serverUrl,new Date(),this.createdName,"1",timeStamp};
	}

}